import scrapy
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor


class TengxSpider(scrapy.Spider):
    name = 'tengx'
    # allowed_domains = ['jianshu.com']
    start_urls = ['http://www.yub2b.com/news/list-49.html']

    def parse(self, response):
        print("sdf")
        le = LinkExtractor(restrict_css='.pages a')
        # 过滤规则的启动
        links = le.extract_links(response)
        print(type(links))
        for link in links:
            print(link)

from scrapy.cmdline import execute

execute("scrapy crawl w2".split(' '))